package cgs_mingdao


type MDApp struct{
	Data MDAppData `json:"data"`
}
type MDAppData struct{
	Sections []Section `json:"sections"`
	ProjectID string `json:"projectId"`
	AppId string `json:"appId"`
}
type Section struct{
	Items []Item `json:"items"`
	Name string `json:"name"`
}
type Item struct{
	ID string `json:"id"`
	Name string `json:"name"`
	Type int `json:"type,omitempty"`
}

func (mdd *MDAppData) FilterItem() {
	sections := []Section{}

	for _, section := range mdd.Sections {
		items := []Item{}
		for _, item := range section.Items {
			if item.Type == 0 {
				items = append(items, item)
			}
		}
		if len(items) > 0 {
			section.Items = items
			sections = append(sections, section)
		}
	}

	mdd.Sections = sections
}
